home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 1 / Macwelt DVD 1.toast / Web-Publishing / HTML-Editoren / Alpha ƒ / Help / Lisp Help < prev    next >
Encoding:
Text File  |  2000-12-01  |  10.1 KB  |  349 lines

  1.  
  2. Lisp Mode Help
  3.  
  4.  
  5.                                           help version: 2.0
  6.                                                created: 03/07/00 {01:10:49 am}
  7.                                            last update: 12/01/00 {01:36:04 pm}
  8.  
  9.  
  10. This document describes the Lisp mode for the software Alpha.  
  11.  
  12.  
  13.           Description of files
  14.  
  15.  
  16. This package includes four files for the Lisp mode:
  17.  
  18.     "lispMode.tcl"        (version 2.0)
  19.     "LispCompletions.tcl"
  20.     "Lisp Tutorial.el"
  21.  
  22. and
  23.  
  24.     Lisp Mode Help (this file)
  25.  
  26. It also includes an update for the Scheme mode, 
  27.  
  28.     "schemeMode.tcl"       (version 2.0)
  29.     "ScmCompletions.tcl"
  30.  
  31.  
  32. A Macintosh version of "PowerLisp" can be found at
  33.  
  34.     <http://www.corman.net/PowerLisp.html>
  35.  
  36. Other Lisp applications can be found at
  37.  
  38.     <http://www.lisp.org/>
  39.  
  40.  
  41.           General Notes About Lisp Mode
  42.  
  43.  
  44. (1)  Lisp mode serves primarily primarily to make it easier to read and
  45.      write Lisp files -- it colorizes keywords, and sets some
  46.      indentation, electric, word break, and commenting preferences.
  47.      
  48.      Lisp mode includes its own menu, which mainly includes Help and
  49.      navigation items, and can allow Alpha to serve as a front end for a
  50.      local Lisp application.  This menu is also be used in Scm mode.
  51.  
  52. (2)  Lisp mode contains a full set of electric completions, as well as a 
  53.      Completions Tutorial via the  "Config --> Mode Prefs"  menu item.
  54.  
  55. (3)  An example syntax file is available via the "Mode Examples Help" file. 
  56.      If you open an example syntax file through the provided hyperlinks, it
  57.      will open in a "shell" window.  After you close the window, clicking
  58.      on the hyperlink will return the unblemished original.
  59.  
  60. (4)  Both Lisp and Scm modes allow for user customization of keyword
  61.      dictionaries via the "Config --> Mode Prefs --> Preferences" dialog. 
  62.      New keywords and color changes will take effect immediately, without
  63.      the need for a restart or changing windows.
  64.      
  65. (5)  Instructions for editing a LispPrefs.tcl file are given below.  
  66.      Any keywords added will not only be colorized, but included
  67.      in the completions routines as well.
  68.  
  69. (6)  Lisp mode has Mark File [M] and Parse Function {} capabilities.
  70.  
  71. (7)  Finally, on-line help is available for the Lisp mode through 
  72.      command double-clicking.  The URL to which the keywords are sent 
  73.      can be configured the the Mode Preferences dialog.
  74.  
  75.  
  76.     ======================================================================
  77.  
  78.  
  79.           Specific Notes About Lisp Mode
  80.  
  81.  
  82.  
  83.                Keywords
  84.  
  85.  
  86. Keyword dictionaries are in "lispMode.tcl", including the lists of:
  87.  
  88.  
  89. Accessors
  90. Classes
  91. Condition Types
  92. Constant Variables
  93. Declarations
  94. Functions
  95. Macros
  96. Restarts
  97. Specials
  98. Standard Generic Functions
  99. Symbols 
  100. System Classes 
  101. Types
  102. Type Specifiers
  103. Variables
  104.  
  105. Keyword dictionaries for Scheme are in "schemeMode.tcl".
  106.  
  107. Note:  As of Alpha 7.4, only keywords of 20 characters or less can be 
  108. properly colorized.  All keywords will, however, be eligible as completions.
  109.  
  110. Both Lisp and Scm modes have a sophisticated indentation procedure, based
  111. upon unmatched parantheses, ignoring parans that appear in comments or
  112. which are embedded in double quotes.  Each mode also has a full set of
  113. electric completions.
  114.  
  115. Example syntax file:  "Lisp Example.el"
  116.  
  117. Example syntax file:  "Scheme Example.scm"
  118.  
  119. Completions Tutorial: "Lisp Tutorial.el"
  120.  
  121.  
  122.                Command double-click
  123.  
  124.  
  125. On-line help is available for Lisp commands through command-double-clicking. 
  126. The URL to which the keywords are sent can be changed through the Mode
  127. Preferences dialog.  If the current text is a macro defined within the
  128. current window, rather than a Stata keyword, command double-clicking on it
  129. will find its definition.
  130.  
  131. Any available syntax information is also available by pressing the control 
  132. key while command-double-clicking.  This information will appear in the 
  133. status bar window.  In some cases, this information is too long to be read 
  134. in its entirety.  Pressing the shift key instead of the control key will 
  135. insert this syntax information as commented text into your current window.
  136.  
  137. NOTE: These control-command and shift-command double-click features have not
  138. been fully implemented.  See the "LispCompletions.tcl" file for additional
  139. information.
  140.  
  141.  
  142.                Carriage Returns
  143.  
  144.  
  145. Lisp mode has its own indentation scheme, based upon unbalanced braces, and
  146. uses the Electric Return, Tab and Braces features.  Each time that you
  147. start a new line with the <return> key, the previous non-commented line is
  148. evaluated for unmatched ( and ) -- ignoring any braces that appear within
  149. double quotes or after valid comment characters.
  150.  
  151. Lines that begin with ) will have their indentation reduced by one level
  152. to match the line with the matching (, as in
  153.  
  154.     (defun R-mode  (&optional proc-name) 
  155.         "Major mode for editing R source.  See S-mode for more help."
  156.         (interactive)
  157.         (setq S-proc-prefix "R"
  158.             ;; S-set-style "GNU"
  159.             S-default-style 'GNU
  160.         )
  161.         (S-mode proc-name)
  162.     )
  163.  
  164. In some cases, as when you are continuing a command, you might want to
  165. over-ride this behavior.  For example, if you type
  166.  
  167.     defv|
  168.  
  169. and press the completion key, the command completes to 
  170.  
  171.     (defvar |)••
  172.  
  173. Typing "cond" and pressing the completion key again turns the line into
  174.  
  175.     (defvar (cond |)••)••
  176.  
  177. If you now press <return>, the next line will automatically indent to
  178.  
  179.     (defvar (cond 
  180.         |)••)••
  181.  
  182. with only one level of indentation.  This would be find if this line
  183. actually terminated the command, but you might want to continue the
  184. command.  To over-ride this behavior, which in this case would increase
  185. the level of indentation for the next line to 2, press <shift>-<return>
  186. instead:
  187.  
  188.     (defvar (cond 
  189.             |)••)••
  190.  
  191. Entire commands can also be reformatted (aligning indentation) with
  192. <control>-<command> I.
  193.  
  194. The "Full Indent" mode preference determines if continued commands are
  195. indented to the full "Indentation Amount" (which can be set in the
  196. "Config --> Electrics" menu), or just half of this value.
  197.  
  198. To enter a carriage return with no indentation whatsoever, press 
  199. <control>-<return>.
  200.  
  201.  
  202.                File Marking
  203.  
  204.  
  205. Lisp file marking searches the current window for all commands that
  206. begin in column 1 of any given row.  The first 35 characters of a
  207. command that begins a new line will be marked.  Section and subsection
  208. headings will be returned as well.
  209.  
  210.  
  211.     The File                    The Mark
  212.     ________                    ________
  213.  
  214.     ;;*;; Section Heading       • Section Heading
  215.     ;;;*;;; Subsection Heading  * Subsection Heading
  216.     (command arguments etc        (command arguments etc
  217.  
  218.  
  219. Function parsing {} will return only the command name, in alphabetical order.
  220.  
  221.  
  222.                Navigation
  223.  
  224.  
  225. Lisp mode has command navigation capabilities, available with the key
  226. bindings control-shift N and P. These items are also bound to control-shift
  227. arrow keys, and to 1 and 3 on the keypad when the num-lock is turned off. 
  228. Entire commands can also be highlighted with control-shift S, or
  229. reformatted (aligning indentation) with control-command I.
  230.  
  231. Control-shift up and down will find the prev/next command.  The right and
  232. left arrow keys not only find prev/next commands, but will also place the
  233. cursor at the top of the window.
  234.  
  235. Entire commands can also be highlighted with control-shift S.
  236.  
  237.  
  238.                Adding a Lisp Prefs file
  239.  
  240.  
  241. To add additional commands or arguments in a "LispPrefs.tcl" file, go to
  242. "Config --> Mode Prefs --> Edit Prefs File", and add these lines:
  243.  
  244.  
  245.     set LispUserCommands {
  246.         blah bladdity
  247.     }
  248.     
  249.     set LispUserArguments {
  250.         blah2 bladdity2
  251.     }
  252.     
  253.     Lisp::colorizeLisp
  254.  
  255.  
  256. To add additional commands or arguments in a "ScmPrefs.tcl" file, go to
  257. "Config --> Mode Prefs --> Edit Prefs File", and add these lines:
  258.  
  259.  
  260.     set ScmUserCommands {
  261.         blah bladdity
  262.     }
  263.     
  264.     set ScmUserArguments {
  265.         blah2 bladdity2
  266.     }
  267.     
  268.     Scm::colorizeScm
  269.  
  270.  
  271. Include as many keywords as desired within the braces, separating each
  272. keyword by at least one space or carriage return.  Alpha will automatically
  273. load this preferences file the first that the Lisp/Scm mode is invoked.
  274.  
  275. Any keywords contained in these categories will not only be colorized, but
  276. will also be included as electric completions.  Don't repeat commands or
  277. arguments that have already been defined.
  278.  
  279.           
  280.     ======================================================================
  281.  
  282.  
  283.           Latest Versions
  284.  
  285.  
  286.  
  287. The latest version of the Lisp mode will be available at
  288.  
  289.     <http://www.princeton.edu/~cupright/computing/alpha/>
  290.  
  291. Updated versions will also be posted to Vince's upload site, 
  292.  
  293.     <ftp://ftp.ucsd.edu/pub/alpha/>
  294.  
  295. and announced on the ALPHA-D mailing list.  This is a mailing list for
  296. Alpha where you can discuss problems, suggest new features etc.  To
  297. subscribe, email <listserv@listserv.syr.edu> and, in the body of your
  298. message (not the subject line), write:
  299.  
  300.     SUBSCRIBE ALPHA-D
  301.  
  302.  
  303.           Future Versions
  304.  
  305.  
  306. The Lisp mode was written as a side-project, by someone who doesn't actually 
  307. write Lisp files.  (I was hoping that being able to decipher files in the 
  308. Emacs Speaks Statistics package would help me write the Statistical modes.)
  309.  
  310. I submit this mode to the Alpha community with the hopes that (i) somebody
  311. else will find it useful, (ii) any errors or updates will be reported to me, 
  312. and (iii) I might inspire somebody to take it even further. I will continue
  313. to maintain it and post updates as necessary, but any contributions are 
  314. certainly welcome.
  315.  
  316.  
  317.  
  318.           License and Disclaimer
  319.  
  320.  
  321. This library is free software; you can redistribute it and/or modify it
  322. under the terms of the GNU Library General Public License as published by
  323. the Free Software Foundation; either version 2 of the License, or (at your
  324. option) any later version.
  325.  
  326. This library is distributed in the hope that it will be useful, but WITHOUT
  327. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  328. FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
  329. License for more details.
  330.  
  331. You should have received a copy of the GNU Library General Public License
  332. along with this library; if not, write to the Free Foundation, Inc., 59
  333. Temple Place, Suite 330, Boston, MA 02111-1307 USA
  334.  
  335. This mode is free.  Alpha is shareware !   <<register>>
  336.  
  337.  
  338. cheers,
  339.  
  340. -- Craig
  341.  
  342.  
  343. Author: Craig Barton Upright
  344. E-mail: <cupright@princeton.edu>
  345.   mail: Princeton University,  Department of Sociology 
  346.         Princeton, New Jersey  08544  USA
  347.    www: <http://www.princeton.edu/~cupright/>
  348.  
  349.